package org.hxzon.workeasy.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.validation.constraints.Size;

import org.hxzon.project.BaseEntity;

@Entity
public class EasyContacts extends BaseEntity implements Comparable<EasyContacts> {

    private static final long serialVersionUID = -2394146567804248902L;

    @Column(columnDefinition = DefineVarchar1024)
    @Size(max = DefineSize1024)
    private String companyName;

    @Column(columnDefinition = DefineVarchar1024)
    @Size(max = DefineSize1024)
    private String companyAddress;

    @Column(columnDefinition = DefineVarchar64)
    @Size(max = DefineSize64)
    private String contactPerson;

    @Column(columnDefinition = DefineVarchar64)
    @Size(max = DefineSize64)
    private String contactEmail;

    @Column(columnDefinition = DefineVarchar32)
    @Size(max = DefineSize32)
    private String contactPhone;

    @Column(columnDefinition = DefineVarchar32)
    @Size(max = DefineSize32)
    private String groupName;

    @Column(columnDefinition = DefineVarchar2048)
    @Size(max = DefineSize2048)
    private String remark;

    public String toString() {
        return this.companyName + "[" + this.contactPerson + "]";
    }

    public boolean equals(Object o) {
        if (o == this) {
            return true;
        }
        if (!(o instanceof EasyContacts)) {
            return false;
        }
        EasyContacts other = (EasyContacts) o;
        return this.getId().equals(other.getId());
    }

    public int hashCode() {
        return this.getId().hashCode();
    }

    public int compareTo(EasyContacts o) {
        return this.getId().compareTo(o.getId());
    }

    public String getCompanyName() {
        return companyName;
    }

    public void setCompanyName(String companyName) {
        this.companyName = companyName;
    }

    public String getCompanyAddress() {
        return companyAddress;
    }

    public void setCompanyAddress(String companyAddress) {
        this.companyAddress = companyAddress;
    }

    public String getContactPerson() {
        return contactPerson;
    }

    public void setContactPerson(String contactPerson) {
        this.contactPerson = contactPerson;
    }

    public String getContactEmail() {
        return contactEmail;
    }

    public void setContactEmail(String contactEmail) {
        this.contactEmail = contactEmail;
    }

    public String getContactPhone() {
        return contactPhone;
    }

    public void setContactPhone(String contactPhone) {
        this.contactPhone = contactPhone;
    }

    public String getGroupName() {
        return groupName;
    }

    public void setGroupName(String groupName) {
        this.groupName = groupName;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

}
